<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html style="height: 100%">
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>

    <style type="text/css">
        * {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
        }

        div {
            width: 100%;
            height: 100%;
            background-color: white;
            padding-left: 1%;
        }

        #d1 {
            width: 90%;
            height: 5%;
            position: relative;
            background-color: white;
            font-family: "宋体";
            font-size: 14px;
            padding-top: 1%;
            padding-left: 1%;
            padding-right: 1%;
        }

        #d1-1 {
            width: 30%;
            height: 100%;

            float: left;
        }

        #d1-2 {
            width: 4%;
            height: 120%;
            background-color: #009688;
            float: right;
            margin-top: -0.5%;
        }

        #d2 {
            width: 90%;
            height: 10%;
            position: relative;

            padding-top: 2%;
            padding-left: 1%;
        }

        #d2 input {
            width: 10%;
            height: 25px;
        }

        #d2 select {
            width: 10%;
            height: 25px;
        }

        #d3 {
            width: 90%;
            height: 10%;
            position: relative;
            background-color: #EEEEEE;
            padding-top: 1%;
            padding-left: 1%;
        }

        #d3-1 {
            width: 9%;
            height: 70%;
            float: left;
            background-color: red;
            padding-top: 0.5%;
            padding-left: 1%;
        }

        #d3-2 {
            width: 9%;
            height: 70%;
            float: left;
            background-color: green;
            margin-left: 1%;
            padding-top: 0.5%;
            padding-left: 1%;
        }

        #d4 {
            width: 90%;
            height: 67%;
            position: relative;
            margin-top: 1%;
        }

        table {
            border-collapse: collapse;
            line-height: 25px;
            width: 100%;
            height: 80%;
            text-align: center;
        }

        a {
            text-decoration: none;
            color: black;
        }

        #d5 {
            margin-top: -28%;
            margin-left: 40%;
            width: 25%;
            height: 30%;
            position: absolute;
            padding-left: 0;
            display: none;

        }

        #d6 {
            width: 100%;
            height: 16%;

            /* margin-top:10%; */
            position: relative;
            padding-left: 0;
            /* padding-top: 2.3%; */
        }

        #d6-1 {
            width: 50%;
            height: 100%;
            float: left;
            background-color: #EEEEEE;
            padding-left: 32%;
            padding-top: 3%;
        }

        #d6-2 {
            width: 50%;
            height: 100%;
            float: right;
            background-color: #EEEEEE;
            padding-left: 33%;
            padding-top: 3%;
        }

        #d7 {
            width: 95%;
            height: 40%;
            position: relative;
            padding-top: 8%;
            font-family: "宋体";
            font-size: 18px;
            padding-left: 15%;


        }

        #d8 {
            width: 100%;
            height: 40%;
            position: relative;


        }

        #d8-1 {
            width: 22%;
            height: 40%;
            position: absolute;
            background-color: #009688;
            padding-top: 2%;
            text-align: center;
            background-color: #009688;
            margin-top: 10%;
            margin-left: 40%;

        }

        #d8-2 {
            width: 22%;
            height: 40%;
            position: absolute;
            margin-left: 70%;
            margin-top: 10%;
            /* 	margin-right:18%;
                margin-top:-2.4%; */
            border: 1px solid black;
            padding-top: 2%;
            text-align: center;

        }

        #d5 a {
            text-decoration: none;
            color: black;
        }

    </style>
</head>
<body style="height: 100%">
<div>
    <div id="d1">

        <div id="d1-1">首页/演示/导航元素</div>
        <div id="d1-2">
            <a href="/repairQueryAll">
                <img src="../image/update.png" width="20px" height="20px">
            </a>
        </div>
    </div>
    <hr width="90%" color="gray">
    <div id="d2">
        <form action="#" method="post">
            房间号&nbsp;<input type="text" name="" value="">&emsp;
            修缮时间&nbsp;<input type="text" name="" value="">&emsp;
            <input type="submit" value="搜索" style="background-color:#009688 ;width: 5%;">
        </form>
    </div>
    <div id="d3">
        <div id="d3-1">
            <img src="../image/delete2.png" width="20px" height="20px" ">
            <a href="#" id="delete">批量删除</a>
        </div>
        <div id="d3-2">
            <img src="../image/add.png" width="20px" height="20px">
            <a href="./serve/repairAdd.html">添加</a>
        </div>
    </div>
    <div id="d4">
        <table border="1">
            <tr>
                <td width="5%">
                    <input type="checkbox" value="">
                </td>
                <td>编号</td>
                <td>房屋地址</td>
                <td>修缮人姓名</td>
                <td>修缮人电话</td>
                <td>修缮时间</td>
                <td>修缮结果</td>

                <td width="9%">管理操作</td>
            </tr>
            <form action="/repairDeleteBatches" method="post">
                <c:forEach items="${list}" var="repair" varStatus="status">
                    <tr>
                        <td><input type="checkbox" value="${repair.r_id}" name="key"></td>
                        <td id="ten">${status.index}</td>
                        <td>${repair.h_address}</td>
                        <td>${repair.l_name}</td>
                        <td>${repair.l_phone}}</td>
                        <td>${repair.r_time}</td>
                        <td>${repair.r_result}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/repairQuery?id=${repair.r_id}" target="i">
                                <img src="../image/alert-circle.png" width="20px" height="20px">
                            </a>&nbsp;
                            <a href="${pageContext.request.contextPath}/repairUpdate?id=${repair.r_id}" target="i">
                                <img src="../image/edit-2.png" width="20px" height="20px">
                            </a>&nbsp;
                            <a href="${pageContext.request.contextPath}/repairDelete?id=${repair.r_id}">
                                <img src="${pageContext.request.contextPath}/image/delete2.png" width="20px" height="20px" onclick="return one()">
                            </a>
                        </td>
                    </tr>
                </c:forEach>
                <input type="submit" style="display: none" id="dosth">
            </form>
        </table>
    </div>
</div>
<script type="text/javascript">
    function one() {

        var b = confirm("确定要删除吗");
        if (b) {
            //location.href = "${pageContext.request.contextPath}/repairDelete?id="+ten.innerText;
            return true;
        } else {
            location.href = "/repairRecordsQueryAll";
        }
    }

    var dodelete = document.getElementById("delete");

    dodelete.onclick = function () {
        var dosth = document.getElementById("dosth");

        dosth.click();
    }
</script>
</div>
</body>
</html>